#!/usr/bin/env python


import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

# enehf
f.add(string = 'Final HF energy',
      rel_tolerance = 1.0e-9)

#surf
f.add(string = 'Surface area',
      rel_tolerance = 1.0e-7)

# nuc
f.add(string = 'Nuclear repulsion energy',
      rel_tolerance = 1.0e-10)

# nucchg
f.add(string = 'NUCLEAR APPARENT CHARGE',
      rel_tolerance = 1.0e-4)

# tes
f.add(string = 'Total number of tesserae',
      rel_tolerance = 1.0e-1)

# qrlrve
f.add(string = 'QRLRVE: SINGLET',
      rel_tolerance = 1.0e-5)

# qrlrve2
f.add(string = '@ QRLRVE:  ',
      rel_tolerance = 1.0e-3)

# omegab
f.add(string = 'omega B',
      ignore_sign = True,
      abs_tolerance = 1.0e-4)

# sym
f.add(string = 'Point group',
      rel_tolerance = 1.0e-5)

f.add(from_string = 'Two-photon absorption summary',
      num_lines = 30,
      rel_tolerance = 1.0e-3,
      ignore_below = 1.0e-3)


test.run(['tpa_pcm_sym.dal'], ['CH2O_STO-3G.mol'], f={'out': f})

sys.exit(test.return_code)
